using System;
using System.IO;

namespace BSDS.Service.Configuration
{
    public class BsdsServiceConfiguration
    {
        public DirectoryInfo InputDirectory { get; private set; }
        public string CommandTemplate { get; private set; }
        public TimeSpan MaxFileCopyTime { get; private set; }
        public FilesPergingOptions FilesPergingOptions { get; private set; }
        public AutoExecutionOptions AutoExecutionOptions { get; set; }

        public BsdsServiceConfiguration(DirectoryInfo inputFolderPath, string commandTemplate, TimeSpan maxFileCopyTime, 
            FilesPergingOptions filesPergingOptions, AutoExecutionOptions autoExecutionOptions)
        {
            InputDirectory = inputFolderPath;
            CommandTemplate = commandTemplate;
            MaxFileCopyTime = maxFileCopyTime;
            FilesPergingOptions = filesPergingOptions;
            AutoExecutionOptions = autoExecutionOptions;
        }
    }

    public class FilesPergingOptions
    {
        public int GeocodedFilesPergingInDays { get; private set; }
        public int SuccessFilesPergingInDays { get; private set; }
        public int FailedFilesPergingInDays { get; private set; }
        public bool CleanTempAfterEachCommand { get; private set; }

        public FilesPergingOptions(int geocodedFilesPergingInDays, int successFilesPergingInDays, 
            int failedFilesPergingInDays, bool cleanTempAfterEachCommand)
        {
            GeocodedFilesPergingInDays = geocodedFilesPergingInDays;
            SuccessFilesPergingInDays = successFilesPergingInDays;
            FailedFilesPergingInDays = failedFilesPergingInDays;
            CleanTempAfterEachCommand = cleanTempAfterEachCommand;
        }
    }

    public class AutoExecutionOptions
    {
        public bool AutoExecute { get; private set; }
        public DateTime ExecutionTime { get; private set; }

        public AutoExecutionOptions(bool autoExecute, DateTime executionTime)
        {
            AutoExecute = autoExecute;
            ExecutionTime = executionTime;
        }
    }
}